﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Cosmetic.Logic;
using Cosmetic.DataEntity;
using System.Collections.Generic;

namespace WebApp.Controls
{
    public partial class FocusProduct_L : System.Web.UI.UserControl
    {
        private ProductManager m_ProductManager = new ProductManager();

        private int m_ShowCount = 3;
        public int ShowCount
        {
            get { return m_ShowCount; }
            set { m_ShowCount = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.BindProduct();
            }
        }

        private void BindProduct()
        {
            this.lvProduct.DataSource = this.m_ProductManager.GetRecommandProductInfo().Take(ShowCount).ToList();
            this.lvProduct.DataBind();
        }
    }
}